#!/usr/bin/env python
from __future__ import with_statement

import sys

from myqq import *
from pymyqq import *

with Client(sys.argv[1], sys.argv[2]) as c:
    for p in c.login():
        if p == P_VERIFYING:
            c.verify(raw_input("please input the captcha in the verify subfolder: "))
            
    for buddy in c.buddies:
        buddy.say("Hello world, imbot from pymyqq <http://code.google.com/p/pymyqq/>!")
        
    for msg, args in c.messages:
        print msg, args['msg']
